package com.spring.gop.proj.dao;


import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.spring.gop.proj.dao.mapper.QnaMapper;
import com.spring.gop.proj.interfaces.QnaDao;
import com.spring.gop.proj.model.*;

@Repository
public class QnaDaoImpl implements QnaDao {
	
	@Autowired QnaMapper qnaMapper;

	public List<Qna> getArticles() {
		return qnaMapper.getArticles();
	}
	
	public Qna getArticle(int num) {
		return qnaMapper.getArticle(num);
	}
	
	public void insertArticle(Qna qna){
		qna.setRegdate(new Timestamp(System.currentTimeMillis()));
		qnaMapper.insertArticle(qna);
	}
	
	public void updateArticle(Qna qna){
		qnaMapper.updateArticle(qna);
}
	
	public void delArticle(int num){
		qnaMapper.delArticle(num);
	}
	
	public String getPasswd(int num){
		return qnaMapper.getPasswd(num);
	}
	
	public void updateNum(Qna qna){
		qnaMapper.updateNum(qna);
	}
	
	public Qna updateGetArticle(int num){
		Qna article=qnaMapper.getArticle(num);
		return article;
	}
	
	public int getMaxNum(){
		return qnaMapper.getMaxNum();
	}
	
	public int getArticleCount(){
		return qnaMapper.getArticleCount();
	}
	
	public void updateHit(int num){
		qnaMapper.updateHit(num);
	}
	
	public List<Qna> getArticles1(Cdt cdt){
		return qnaMapper.getArticles1(cdt);
	}
	
	public int getArticleCount1(Cdt cdt){
		return qnaMapper.getArticleCount1(cdt);
	}
	
	public List<Qna> getArticles2(Cdt cdt){
		return qnaMapper.getArticles2(cdt);
	}
	
	public List<Qna> selectListForId(String member_id) {
		return qnaMapper.selectListForId(member_id);
	}
	
	
	
	
	
	
	
	
	public List<Qna> getArticles3() {
		return qnaMapper.getArticles3();
	}
	
	
	public Qna getArticle1(int num) {
		return qnaMapper.getArticle1(num);
	}
	
	public void insertArticle1(Qna qna){
		qna.setRegdate(new Timestamp(System.currentTimeMillis()));
		qnaMapper.insertArticle1(qna);
	}
	
	public void updateArticle1(Qna qna){
		qnaMapper.updateArticle1(qna);
}
	
	public void delArticle1(int num){
		qnaMapper.delArticle1(num);
	}
	
	public String getPasswd1(int num){
		return qnaMapper.getPasswd1(num);
	}
	
	public void updateNum1(Qna qna){
		qnaMapper.updateNum1(qna);
	}
	
	public Qna updateGetArticle1(int num){
		Qna article=qnaMapper.getArticle1(num);
		return article;
	}
	
	public int getMaxNum1(){
		return qnaMapper.getMaxNum1();
	}
	
	public int getArticleCount2(){
		return qnaMapper.getArticleCount2();
	}
	
	public void updateHit1(int num){
		qnaMapper.updateHit1(num);
	}
	
	public List<Qna> getArticles4(Cdt cdt){
		return qnaMapper.getArticles4(cdt);
	}
	
	public int getArticleCount3(Cdt cdt){
		return qnaMapper.getArticleCount3(cdt);
	}
	
	
	public List<Qna> getArticles5(Cdt cdt){
		return qnaMapper.getArticles5(cdt);
	}
	
	
	
}